package com.tang.sharding.algorithm;

import io.shardingsphere.api.algorithm.sharding.PreciseShardingValue;
import io.shardingsphere.api.algorithm.sharding.RangeShardingValue;
import io.shardingsphere.api.algorithm.sharding.standard.PreciseShardingAlgorithm;
import io.shardingsphere.api.algorithm.sharding.standard.RangeShardingAlgorithm;

import java.util.Collection;

/**
 * @author Tang
 * @classname BaseShardingAlgorithm
 * @description [  ]
 * @date 2021/8/3 16:28
 */
public interface BaseShardingAlgorithm<T extends Comparable<?>> extends PreciseShardingAlgorithm<T>, RangeShardingAlgorithm<T> {

    /**
     * 精确
     * @param shardingValue
     * @return
     */
     default String doPreciseSharding(PreciseShardingValue<T> shardingValue){
         return null;
     }

    /**
     * 范围
     * @param shardingValue
     * @return
     */
    default Collection<String> doRangeSharding(RangeShardingValue<T> shardingValue){
        return null;
    }

}